package com.micro.school.order.entity;

import com.micro.school.order.domain.PayStudentFeePayment;
import com.micro.school.order.domain.PayStudentFeePaymentDetail;
import com.micro.school.order.vo.PayStudentFeePaymentDetailExcelVo;
import com.micro.school.order.vo.PayStudentFeePaymentExcelVo;

/**
 * 支付类型名字转换
 */
public class PayMethodStaticEntity
{
    public static String getPayMethodName(PayStudentFeePaymentDetail pay){
        String method = getPayMethod(pay.getPayMethod());
        if(null!=method){
            return method;
        }
        return "预付款";
    }
    public static String getPayMethodName(PayStudentFeePayment pay){
        String method = getPayMethod(pay.getPayMethod());
        if(null!=method){
            return method;
        }
        return "预付款";
    }

    public static void setPayMethodName(PayStudentFeePaymentDetailExcelVo excelVo){
        if(null==excelVo.getPrepaymentMethod()){
            return;
        }
        excelVo.setPayMethodName(getPayMethod(Long.parseLong(excelVo.getPrepaymentMethod())));
    }

    public static String getPayMethodName(PayStudentFeePaymentExcelVo pay){
        String method = getPayMethod(pay.getPayMethod());
        if(null!=method){
            return method;
        }
        return "预付款";
    }

    private static String getPayMethod(Long method){
        if(null==method){
            return "预付款";
        }
        if("001".equals(method.toString())){
            return "条码支付";
        }
        if("101".equals(method.toString())){
            return "微信条码";
        }
        if("102".equals(method.toString())){
            return "微信二维码";
        }
        if("103".equals(method.toString())){
            return "微信公众号";
        }
        if("104".equals(method.toString())){
            return "微信小程序";
        }
        if("105".equals(method.toString())){
            return "微信App";
        }
        if("201".equals(method.toString())){
            return "支付宝条码";
        }
        if("202".equals(method.toString())){
            return "支付宝二维码";
        }
        if("203".equals(method.toString())){
            return "支付宝服务窗";
        }
        if("204".equals(method.toString())){
            return "支付宝小程序";
        }
        if("205".equals(method.toString())){
            return "支付宝App";
        }
        if("301".equals(method.toString())){
            return "云闪付条码";
        }
        if("302".equals(method.toString())){
            return "云闪付二维码";
        }
        if("303".equals(method.toString())){
            return "云闪付服务窗";
        }
        if("304".equals(method.toString())){
            return "云闪付小程序";
        }
        if("305".equals(method.toString())){
            return "云闪付App";
        }
        if("601".equals(method.toString())){
            return "聚合码";
        }
        if("000".equals(method.toString())){
            return "默认";
        }
        if("206".equals(method.toString())){
            return "支付宝刷脸";
        }
        return "预付款";
    }
}
